#ifndef __DBACCOUNT_LOGIN_SUCCESSSENDER_H__
#define __DBACCOUNT_LOGIN_SUCCESSSENDER_H__

#include "gwmessagemap.hpp"
#include "IMessageOperator.h"
#include "protonet.hpp"
#include "netlib.h"
#include "../DBServer.h"
#include "dbserver.pb.h"
#include "../../Sender/DBServerSender.h"

/**
*@file       DBAccount_Login_SuccessSender.h
*@brief      send message DBAccount_Login_Success
*
*@author     graywind
*@version    1.0.0.0
*@data       2012/3/28
*/

///message wrapper
class msgDBAccount_Login_Success
{
public:
    static const int MessageId = DBAccount_Login_Success;
    //TODO
    pnSessionHandle SessionId;
    AccountDigestInfo* MsgContent;
    ///@brief     constructor
    ///param[in]  session_id     identifier of the session
    ///param[in]  msg_content    pointer of the AccountDigestInfo instance
    msgDBAccount_Login_Success(int session_id, AccountDigestInfo* msg_content):
    SessionId(session_id),
    MsgContent(msg_content)
    {

    }
};

class HandleDBAccount_Login_Success
{
public:
    ///@brief     handle message
    ///param[in]  msg     message wrapper of DBAccount_Login_Success
    ///retval     void
    static void HandleMessage(msgDBAccount_Login_Success* msg)
    {
        //TODO
        //Main Message:  msgDBServer
        msgDBServer mainMsg(msg->SessionId, msgDBAccount_Login_Success::MessageId, ProtoNet<AccountDigestInfo>::IntoBytes(*(msg->MsgContent)));
        gwMessagePort::ProcessMessage(&mainMsg);
    }
};
///[message wrapper]  [handler]
RegisterHandler(msgDBAccount_Login_Success, HandleDBAccount_Login_Success);

#endif
